<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Decorator</title>
</head>
<body>
    <script>


        let pfn = (fn) => {
            return fn
        }

        @pfn
        class Person{
            constructor(name) {
                this.name = name
            }
            sleep() {
                console.log(`${this.name}, 正在睡觉`)
            }
        }

        console.log(
            new Person('111').sleep()
        )

    </script>
</body>
</html>